package com.bj58.mis.apm.processor.impl;

import com.bj58.mis.apm.client.core.ApmLogEntity;
import com.bj58.mis.apm.client.core.AppNodeContext;
import com.bj58.mis.apm.client.core.BaseCollectLog;
import com.bj58.mis.apm.client.core.util.JsonUtil;
import com.bj58.mis.apm.processor.Prosessor;

public class DefaultProsessorImpl implements Prosessor {
    @Override
    public ApmLogEntity prosess(BaseCollectLog log) {
        ApmLogEntity entity = new ApmLogEntity();
        entity.setAppName(AppNodeContext.appName);
        entity.setHostName(AppNodeContext.hostName);
        entity.setType(log.getCollectType());
        entity.setLogData(JsonUtil.toJson(log));
        return entity;
    }
}
